package org.spring.boot;


import java.util.HashMap;
import java.util.Map;

import org.spring.servlet.DispatcherServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;


/**
 * Web配置
 * 
 * @author chenle
 *
 */
@Configuration
public class WebConfiguration extends WebMvcConfigurerAdapter {
    

    @Bean
    public ServletRegistrationBean testBusinessModuleServletRegistrationBean() {
        ServletRegistrationBean testBusinessModuleServletRegistrationBean = new ServletRegistrationBean(
                new DispatcherServlet(), "/");
        testBusinessModuleServletRegistrationBean.setName("cms-bls-test");
        Map<String, String> initParameters = new HashMap<String, String>();
        initParameters.put("contextConfigLocation", "application.properties");
        testBusinessModuleServletRegistrationBean.setInitParameters(initParameters);
        testBusinessModuleServletRegistrationBean.setLoadOnStartup(0);
        return testBusinessModuleServletRegistrationBean;
    }

}
